<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

<style type="text/css">
    ul.errorlist {
        margin: 0;
        padding: 0;
    }
    .errorlist li {
        background-color: red;
        color: white;
        display: block;
        font-size: 10px;
        margin: 0 0 3px;
        padding: 4px 5px;
    }
</style>

<html lang="en">
<head>
    <title>Rate Class</title>
</head>
<body>
    
	
	<form action="." method="GET">
		<label for="q">Enter Department: </label>
	    <input type="text" name="q" value="{{ query|escape }}">
		<p>
		<label for="q1">Enter Class Number: </label>
	    <input type="text" name="q1" value="{{ query1|escape }}">
		<p>
		<input type="submit" value="Search">
	</form>
	
	{% if query and query1 %}
    <h2>Results for "{{ query|escape }} {{query1|escape}}":</h2>

    {% if results %}
	  <ul>
        {% for result in results %}
        <li>{{ result.department|escape }} {{ result.class_field|escape }} - {{ result.name|escape }}<br> {{result.id|escape}}<p>  {{ result.description|escape }}</li>
      {% endfor %}
     </ul>
	 
	<h1>Ratings!</h1>
    <form action="." method="POST">
        <table>
            {{ form.as_table }}
        </table>
        <p><input type="submit" value="Submit"></p>
    </form>
	 
    {% else %}
      <p>No classes found</p>
    {% endif %}
  {% else %}
	<p>Please enter a non blank query!<p>
  {% endif %}
	
	
</body>
</html>



  
